﻿using System;
using System.Configuration;

    
    public class PubConstant
    {        
        /// <summary>
        /// 获取连接字符串
        /// </summary>
        public static string ConnectionString
        {           
            get 
            {
                IniFiles myini = new IniFiles(System.Environment.CurrentDirectory + "\\system.ini");

                string serverName = myini.ReadString("DBCONFIG", "SERVERNAME", "127.0.0.1");
                string dbName = myini.ReadString("DBCONFIG", "DatBaseName", "TaxiDispatchSystem");
                string uid = myini.ReadString("DBCONFIG", "UserID", "root");
                string pwd = myini.ReadString("DBCONFIG", "PassWord", "123456");
                //BtsServer.DbName = DbName;
                serverName = "221.232.148.74";
                //dbName = "TaxiDispatchSystem";
                //uid = "root";
                //pwd = "123456";
                //string connectStr = "Server=.;Database=powersystem;Uid=sa;Connection Timeout=8;Pwd=123456";
                //string connectStr = "Server=221.232.148.74;Port=3306;Database=SouFun;Uid=root;Pwd=123456;";


                string connectStr =
                    "server=221.232.148.74;user id=root;Password=123456;persist security info=True;database=SouFun;character set=utf8";
                //string connectStr = "Server=" + serverName + ";Database=" + dbName + ";port=3306;Uid=" + uid + ";Connection Timeout=30;charset=utf8;Pwd=" + pwd;
                return connectStr;
            }
        }

    }
